<?php
header ( 'Content-type: text/html; charset=utf-8' );
$mysql_server_name = "localhost";
$mysql_username = "root";
$mysql_password = "root";
$mysql_database = "db_shop";

$conn = mysql_connect ( $mysql_server_name, $mysql_username, $mysql_password );
mysql_query ( "set names 'utf8'" );

// require_once('page.php');
// page($sql,'room.php',"5");//这几句是分页的句子
// $sql = " SELECT * FROM room ORDER BY room_id DESC limit".$begincount.",".$rows;
mysql_select_db ( $mysql_database );

$id = $_POST ['id'];

$name = $_POST ['name'];
$gender = $_POST ['sex'];
$age = $_POST ['age'];
$member_id = $_POST ['member'];
$check_time = $_POST ['checktime'];
$check_out_time = $_POST ['outtime'];
$check_num = $_POST ['number'];
$room_id = $_POST ['room_id'];
$room_cost = $_POST ['cost'];
$deposit = $_POST ['deposit'];
$enjoy_benefits = $_POST ['benefits'];

$sql = "UPDATE hotel.custom SET name='$name',gender='$gender',age='$age',member_id='$member_id' ,check_time='$check_time',check_out_time='$check_out_time',check_num='$check_num',room_id='$room_id',room_cost='$room_cost',deposit='$deposit',enjoy_benefits='$enjoy_benefits' where document_id='$id'";
mysql_select_db ( $mysql_database );
$result = mysql_query ( $sql );

if (! $result) {
	echo "<font size= '8'>PHP ERROR:错误信息，修改失败！请返回上一页</font><br>" . "<a href ='javascript:history.go(-1)'>鐐瑰嚮杩斿洖</a>";
} else {
	echo "<script language=javascript>alert(\'修改成功');window.location='custom_info.php?id=" . $id . "';</script>";
}

?>
